package cn.jzq.kotoba.modules.designpattern2.strategy;

/**
 * @author jzq
 * @date 2019/4/16 15:03
 */
public class DragonSlayer {
    private String name;

    ShootBehavior shootBehavior;

    public DragonSlayer(String name) {
        this.name = name;
    }

    public void goToBattle() {
        System.out.println(name + "使用体术, 对敌人造成了10点伤害");
    }

    public void jump(){
        System.out.println(name + "成功的使用跳跃,避开了攻击");
    }


    public void userHolyWater() {
        System.out.println(name + "使用了圣水, 回复了100HP");
    }

    public void battleWithBow(){
        shootBehavior.shoot();
    }

    public void setShootBehavior(ShootBehavior shootBehavior) {
        this.shootBehavior = shootBehavior;
    }
}
